<!DOCTYPE html>

<html>
<head>
	<title>GW2 Events - Perfil</title>
	<script src="./js/css.js"></script>
	<link rel="stylesheet" href="./css/style.css">
</head>

<body>
	<header>
		<div class="logo_container">
			<a href="/main"><img alt="Guild Wars 2 Events" src="img/logo.png"></a>
		</div>
		<div class="buttons_container">
			<a href="/logout">
				<button id="button_logout" type="button" class="logout_mouseOut" 
					onmousedown="logoutMouseDown()" onmouseover="logoutMouseOver()"
					onmouseout="logoutMouseOut()" onmouseup="logoutMouseOver()"></button>
			</a>
		</div>
	</header>
	<article>
		<form action="/profile" method="post">
			<div class="profile_field">
				<label for="username">Nombre de usuario </label><br>
				<input type="text" id="username" name="username" value="{{user['_id']}}" readonly="readonly">
			</div>
			<div class="profile_field">
				<label for="email">Email </label><br>
				<input type="email" id="email" name="email" value="{{user['email']}}">
			</div>
			<div class="profile_field">
				<label for="alert_enabled">Alertas activadas</label><br>
				<input type="checkbox" id="alert_enabled" name="alert_enabled" {% if user.enable_alerts == true %}checked="checked"{% endif %}>
			</div>		
			<div class="profile_field">
				<span>Tiempo de aviso</span><br>
				<select id="alert_time" name="alert_time">
					<option value="0" {% if user.time_alert == "0" %}selected="selected"{% endif %}>Al empezar</option>
					<option value="5" {% if user.time_alert == "5" %}selected="selected"{% endif %}>5 minutos antes</option>
					<option value="10" {% if user.time_alert == "10" %}selected="selected"{% endif %}>10 minutos antes</option>
				</select>
			</div>
			
			<div class="form_submit">
				<button id="button_save" type="submit" class="save_mouseOut" 
					onmousedown="saveMouseDown()" onmouseover="saveMouseOver()"
					onmouseout="saveMouseOut()" onmouseup="saveMouseOver()">
				</button>
			</div>
		</form>
	</article>
	<footer> 
		<img alt="Universidad de Sevilla" src="img/us_logo.png">
		<span>Trabajo de la asignatura Diseño de Aplicaciones Web</span>
		<span>Autor: Álvaro Tristancho</span>
	</footer>
</body>

</html>